#ifndef ACCELEROMETER_H
#define ACCELEROMETER_H

#include <QObject>
#include <QtSerialPort/QSerialPort>
#include <QTimer>
#include <QDebug>
//#include <qcustomplot.h>
#include <QVector>
class Accelerometer : public QObject
{
	Q_OBJECT
public:
	explicit Accelerometer(QObject *parent = 0,QString port="COM6");

signals:
	void gDataComing(short x,short y,short z);
public slots:
	void showRecvData();
private:
	QSerialPort * portReader;
	QByteArray data;
    QString serial_frame;
	short x,y,z,g;
};

#endif // ACCELEROMETER_H
